package tgc.edu.yzy.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import tgc.edu.yzy.custom.CommonService;
import tgc.edu.yzy.entity.EimAdmin;
import tgc.edu.yzy.entity.EimInvoice;
import tgc.edu.yzy.entity.EimUser;
import tgc.edu.yzy.repostory.EimInvoiceRepository;
@Service
public class InvoiceService extends CommonService<EimInvoice,Integer>{
	@Autowired
	private EimInvoiceRepository indao;
	
	public Page<EimInvoice> findByEimadmin(Pageable pageable, EimAdmin id) {
		return indao.findByEimadmin(pageable,id);
	}

	public List<EimInvoice> findByEimuser(EimUser id) {
		return indao.findByEimuser(id);
	}

	public EimInvoice findByNumber(String number) {
		return indao.findByNumber(number);
	}

	public void deleteByEimadmin_id(Integer user2) {
		indao.deleteByEimadmin_id(user2);
	}

	public long countByEimadmin(EimAdmin eimadmins) {
		return indao.countByEimadmin(eimadmins);
	}

}
